// require('./bootstrap');

var mgRoute = {
    //登录
    login: "/mg/login/login",
    profile: "/mg/user/getUserIdByToken",
    bind: "/mg/user/bindingRelationship",
    invite: "/mg/user/inviteLink",
    inviteList: "/mg/user/teamPerformance",
    control: "/mg/user/windControl",
    beforeOrder: "/mg/productUser/downOrderBefore",
    submitOrder: "/mg/productUser/downOrderBut",
    afterOrder: "/mg/productUser/pledge",
    info: "/mg/productUser/info",
    withdraw: "/mg/wallet/withdraw",
    dRecord: "/mg/productUser/pledgeRecord",
    eRecord: "/mg/userEarnings/earningsRecord",
    wRecord: "/mg/walletMention/withdrawalRecord",
    teamBenefits: "/mg/taskTest/teamBenefits",
    staticIncome: "/mg/taskTest/staticIncome",
    calculationGrade: "/mg/taskTest/calculationGrade",
    coinInfo: "/mg/user/coinInfo",
    rank: "/mg/user/nodeRank",
};

function mgToken(token) {
    var k = "mgtoken";
    if (token) {
        sessionStorage.setItem(k, token);
    } else {
        return sessionStorage.getItem(k);
    }
}

function mgUser(user) {
    var k = "mguser";
    if (user) {
        sessionStorage.setItem(k, JSON.stringify(user));
    } else {
        return JSON.parse(sessionStorage.getItem(k));
    }
}
function parseStringToStar(str) {
    return str.length > 10 ? str.substr(0, 4) + '****' + str.substr(-4) : str
}